<?php
/**
 * alltosun.com 核销平台 group_platform.php
 * ============================================================================
 * 版权所有 (C) 2009-2013 北京互动阳光科技有限公司，并保留所有权利。
 * 网站地址: http://www.alltosun.com
 * ----------------------------------------------------------------------------
 * 许可声明：这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * $Author: 王德康 (wangdk@alltosun.com) $
 * $Date: 2015-11-29 下午12:24:56 $
 * $Id: group_platform.php 153083 2015-12-09 06:50:33Z gaoa $
 */

class group_platform_widget
{
    /**
     * 获取核销平台的展示列表
     */
    public function get_group_platform_list()
    {
        $filter = array();
        $filter['status'] = 1;

        $platform_list = _model('group_platform')->getList($filter, 'ORDER BY `sort` DESC');
        
        if ($platform_list) {
            $group_platform_list = array();
            foreach ($platform_list as $k => $v) {
                if ($v['id'] == 1) {
                    $group_platform_list[$k]['group_platform_pic'] = _image($v['group_platform_pic'], 'big', 'group_platform');
                    $group_platform_list[$k]['width']  = 540;
                    $group_platform_list[$k]['height'] = 639;
                } else {
                    $group_platform_list[$k]['group_platform_pic'] = _image($v['group_platform_pic'], 'middle', 'group_platform');
                    $group_platform_list[$k]['width']  = 540;
                    $group_platform_list[$k]['height'] = 318;
                }
                $group_platform_list[$k]['add_time']            = $platform_list[$k]['add_time'];
                $group_platform_list[$k]['group_platform_name'] = $platform_list[$k]['group_platform_name'];
                $group_platform_list[$k]['id']                  = $platform_list[$k]['id'];
                $group_platform_list[$k]['is_open']             = $platform_list[$k]['is_open'];
                $group_platform_list[$k]['sort']                = $platform_list[$k]['sort'];

            }
            return $group_platform_list;
        }

        return 0;
    }
}